
function F (p1, p2, p3) {
    if (!(this instanceof F)) {
        return new F(p1, p2, p3);
    }

    //TODO:
    this.p1 = p1;
    this.p2 = p2;
    this.p3 = p3;
}

F.prototype = {
    f1: function () {
        console.log("p1 = ", this.p1, ", ", "p2 = ", this.p2, ", ", "p3 = ", this.p3);
    },
    f2: function (p1) {
        this.p1 += p1;
        console.log("p1 = ", this.p1, ", ", "p2 = ", this.p2, ", ", "p3 = ", this.p3);
    }
}
F.prototype.constructor = F;

var f1 = new F(1, 2, 3);
f1.f1();

var f2 = F(10, 11, 12);
f2.f2(10);
